package com.fuyao.cloud.message.dto;

import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
public class BaseMessageManagement {
    @ApiModelProperty(value = "主键Id")
    private Long id;

    @ApiModelProperty(value = "租户ID")
    private Long tenantId;

    @ApiModelProperty(value = "单位、部门ID")
    private Long deptId;

    @ApiModelProperty(value = "部门全名称")
    private String deptFullname;

    @ApiModelProperty(value = "创建人")
    private String createBy;

    @ApiModelProperty(value = "创建人ID")
    private Long createId;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "唯一编码（用于关联附件）")
    private String unid;

    @ApiModelProperty(value = "标题")
    private String subject;

    @ApiModelProperty(value = "文档类型")
    private String doctype;

    @ApiModelProperty(value = "文档ID")
    private Long sourceid;

    @ApiModelProperty(value = "分类ID")
    private Long ctiId;

    @ApiModelProperty(value = "分类名称")
    private String ctiName;

    @ApiModelProperty(value = "分类全名称")
    private String ctiFullname;

    @ApiModelProperty(value = "分类全编码")
    private String ctiFullcode;

    @ApiModelProperty(value = "状态默认为0{0：启用、1：禁用}")
    private Integer status;

    @ApiModelProperty(value = "消息描述")
    private String infor;

    @ApiModelProperty(value = "打开超链接")
    private String openUrl;

    @ApiModelProperty(value = "打开类型")
    private String openType;

    @ApiModelProperty(value = "备注")
    private String remarks;

    @ApiModelProperty(value = "完成时限0：长期坚持；1：周期完成。如果是周期完成就必须填写开始结束时间")
    private String timelimitType;

    @ApiModelProperty(value = "开始时间（精确到天）")
    private LocalDate startdate;

    @ApiModelProperty(value = "结束时间（精确到天）")
    private LocalDate enddate;

    @ApiModelProperty(value = "提醒方式(支持多选格式如0,0,0；代表短信、系统消息、邮件。1代表需要，0代表不需要中)")
    private String mode;

    @ApiModelProperty(value = "提醒方式(支持多选格式如0,0,0；代表短信、系统消息、邮件。1代表需要，0代表不需要中)")
    private String[] modes;

    public String[] getModes() {
        return StrUtil.split(this.mode, ',').toArray(new String[]{});
    }
}
